//displays a nice load screen while files load

var doll = (function(_doll) {
    
    _doll.load_screen = _doll.load_screen || {};

    _doll.load_screen.init = function () {
        //user set the number of files you need to load in total
        _doll.load_screen.tasks = 0;
    };
    _doll.load_screen.all_done = function() { return _doll.load_screen.tasks == 0; };

    _doll.load_screen.progress = function(asset_type, asset_file) {
        return function(evt) {
            console.log("Loading = " + asset_type + " = " + asset_file);
        }
    };

    _doll.load_screen.complete = function(asset_type, asset_file) {
        return function(evt) {
            console.log("Loading = " + asset_type + " = " + asset_file);
            _doll.load_screen.tasks--;
        }
    };

    _doll.load_screen.failed = function(asset_type, asset_file) {
        return function(evt) {
            console.log("Failed to load " + asset_type + " = " + asset_file + "!");
            _doll.load_screen.tasks--;
        }
    };

    _doll.load_screen.canceled = function(asset_type, asset_file) {
        return function(evt) {
            console.log(asset_type + " = " + asset_file + " canceled by user.");
            _doll.load_screen.tasks--;
        }
    };

    return _doll;
}(doll || {}));
